<template>
  <div class="app-container">
    <div class="filter-container">
    </div>
    <el-table :key="tableKey"
              v-loading="listLoading"
              :data="list"
              border
              fit
              highlight-current-row
              style="width: 100%">
      <el-table-column prop="Id"
                       label="Id"
                       width="180">
      </el-table-column>
      <el-table-column prop="Date"
                       label="Date"
                       width="180">
      </el-table-column>
      <el-table-column prop="Logger"
                       label="Logger">
      </el-table-column>
      <el-table-column prop="Level"
                       label="Level">
      </el-table-column>
      <el-table-column prop="Callsite"
                       label="Callsite">
      </el-table-column>
      <el-table-column prop="Processid"
                       label="Processid">
      </el-table-column>
      <el-table-column prop="Threadid"
                       label="Threadid">
      </el-table-column>
      <el-table-column prop="Message"
                       label="Message">
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button size="mini"
                     @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { read } from '@/api/log/syslog'

export default {
  name: 'LogSystem',
  components: {

  },
  data () {
    return {
      tableKey: 0,
      listLoading: true,
      list: null
    }
  },
  created () {
    this.getList()
  },
  methods: {
    getList () {
      this.listLoading = true
      read().then(response => {
        console.log(response)
        this.list = response.Data
        this.listLoading = false
      })
    },
    handleEdit (index, row) {
    }
  }
}
</script>
